package com.itheima.a03mybufferedstream;

import java.io.*;

public class BufferedStreamDemo1 {
    public static void main(String[] args) throws IOException {
        //熟悉字节缓冲流

        //创建对象并关联文件
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("myio\\aa.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("myio\\bb.txt"));

        //拷贝
        //一次读多个字节
        byte[] buf = new byte[1024];
        int l;
        while ((l=bis.read(buf))!=-1){
            bos.write(buf,0,l);
        }

        //关流
        bos.close();
        bis.close();
    }
}
